import java.io.*;

public class two {
    public static void main(String[] args) throws IOException {
        File file = new File("E://test.txt");
        InputStream inputStream = null;
        try {
            inputStream = new FileInputStream(file);
            byte[] messenger = new byte[1024];

            int t, idx = 0;
            while ((t = inputStream.read() )!= -1) {
                messenger[idx] = (byte) t;
                idx ++ ;
            }
//            int length = inputStream.read(messenger);
//
            System.out.println(new String(messenger, 0, idx));

        }catch (Exception e) {

        } finally {
            if (inputStream != null) {
                inputStream.close();
            }
        }

    }
}
